package com.gdw.controller;


import com.gdw.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {

    @Autowired
    private User user;

    public void printUser(){
        System.out.println(user);
        //对user对象进行修改
        User myUser = user;
        myUser.setName("我在UserController中修改了名字，我叫猪八戒！");
        System.out.println("myUser name:" + myUser.getName());
        System.out.println("User name:" + user.getName());
    }
}
